<script setup>
import { ref } from "vue"
import { useRouter } from 'vue-router';
import { onMounted, onUnmounted } from 'vue';

const router = useRouter();



let gotoBack = () => {
    
    router.back()
    // window.location.reload(); // 刷新当前页面
    // showToast('返回成功')

}

onMounted(() => {
  console.log('返回组件挂载了');
});
 
onUnmounted(() => {
  console.log('返回组件即将销毁');
  // 当组件卸载时执行
//   document.body.classList.remove('no-scroll');
});

// destroyed() {
//  this.$store.dispatch("cleartList");
// }

</script>

<template>
    <div class="my-back" >
        <p class="back-bg" @click="gotoBack"> </p>
        <van-icon  class="back-icon" name="arrow-left" size="26px" @click="gotoBack" color="#ffffff" />
    </div>


</template>

<style scoped>

.back-bg{
    width: 32px;
    height: 32px;
    background-color: #181616;
    opacity: 0.5; /* 设置透明度为50% */
    z-index: 1;
    border-radius: 16px;
}
.back-icon{
    position: relative;
    top: -45px;
    left: 1px;
	z-index: 2;
}

</style>